package com.lunchEveryDay.service;

import com.lunchEveryDay.dao.BaseDao;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Admin on 2015/7/21.
 */
@Service
abstract class BaseService<E,PK extends Serializable> {
	abstract BaseDao<E,PK> getDao();
	public E get(PK id)
	{
		return getDao().get(id);
	}
	public void save(E e)
	{
		 getDao().save(e);
	}
	public void saveOrUpdate(E e)
	{
		getDao().saveOrUpdate(e);
	}
	public void update(E e)
	{
		getDao().update(e);
	}
	public void delete(E e)
	{
		getDao().delete(e);
	}
	public List<E> listAll() {
		return getDao().listAll();
	}
	public boolean deleteById(PK id) {
		return getDao().deleteById(id);
	}
}
